package com.cs.user.domain.constants;

import lombok.Getter;

@Getter
public enum RoleNameEnum {

    SUPER_ADMIN(0,"超级管理员"),

    ADMIN(1,"管理员"),

    USER(2,"普通用户");

    public Integer code;

    public String name;

    RoleNameEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public static RoleNameEnum getByCode(int codeVal){
        for(RoleNameEnum resultCodeEnum : RoleNameEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
